package coroutines

import kotlin.coroutines.*

class CoroutineTestMain {
}

fun main() {
    val continuation = suspend{
        println("哔哩哔哩")
        2233
    }.createCoroutine(object: Continuation<Int> {
        override fun resumeWith(result: Result<Int>) {
            println("你输入的是：${result.getOrNull()}")
        }

        override val context: CoroutineContext
            get() = EmptyCoroutineContext
    })

    continuation.resume(println("666"))

    println()

    suspend {
        println("22娘， 22娘")

        666
    }.startCoroutine(object:Continuation<Int>{
        override fun resumeWith(result: Result<Int>) {
            println("你输入的数字是${result.getOrNull()}")
        }

        override val context: CoroutineContext
            get() = EmptyCoroutineContext
    })
}